package bigdecimal;

import java.math.BigDecimal;
import java.math.RoundingMode;

public class Test1 {

    public static void main(String[] args) {

//        System.out.println(0.2+0.1);
//
//        System.out.println(0.3-0.2);
//
//        System.out.println(0.3*0.2);
//
//        System.out.println(0.3/0.2);


        double x=1.23;

        BigDecimal b1=new BigDecimal(1.99);

        //System.out.println(b1);


        BigDecimal b2=new BigDecimal("1.99");
        BigDecimal b3=new BigDecimal("4.01");
//        System.out.println(b2.add(b3));
//
//        System.out.println(b2.subtract(b3));
//
//        System.out.println(b2.multiply(b3));

        System.out.println(b2.divide(b3,4, RoundingMode.HALF_UP));

    }

}
